package com.jackstraw.jack_base.datasource.moredatasource.config;


import com.jackstraw.jack_base.datasource.database.parten.config.DataBaseConfiguration;
import com.jackstraw.jack_base.datasource.database.parten.entity.bean.DataBaseTemplateCut;
import com.jackstraw.jack_base.datasource.moredatasource.bean.HikariDataBaseEntity;
import com.jackstraw.jack_base.datasource.moredatasource.bean.HikariDataBaseFactory;
import com.jackstraw.jack_base.datasource.moredatasource.bean.HikariDataBaseProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.transaction.annotation.EnableTransactionManagement;


@Slf4j
@Configuration
@EnableTransactionManagement
@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
public class HikariDataBaseConfiguration
        extends DataBaseConfiguration<HikariDataBaseEntity, HikariDataBaseFactory, HikariDataBaseProperties, HikariDataBaseConfiguration> {


    public HikariDataBaseConfiguration(ApplicationContext applicationContext, Environment environment) {
        super(applicationContext, environment);
    }

    @Override
    public HikariDataBaseProperties properties() {
        return new HikariDataBaseProperties();
    }

    @Override
    public HikariDataBaseFactory dataSourceBuildFactory() {
        return new HikariDataBaseFactory();
    }



}
